<?php

/*
 * This file is part of the overtrue/laravel-wechat.
 *
 * (c) overtrue <i@overtrue.me>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

return [
    /*
     * 默认配置，将会合并到各模块中
     */
    'defaults'         => [

        /**
         * 日志配置
         *
         * level: 日志级别, 可选为：
         *         debug/info/notice/warning/error/critical/alert/emergency
         * path：日志文件位置(绝对路径!!!)，要求可写权限
         */
        'log' => [
            'default' => 'dev', // 默认使用的 channel，生产环境可以改为下面的 prod
            'channels' => [
                // 测试环境
                'dev' => [
                    'driver' => 'single',
                    'path' => ROOT_PATH.'logs/'.date('Y-m-d').'/easywechat.log',
                    'level' => 'debug',
                ],
                // 生产环境
                'prod' => [
                    'driver' => 'daily',
                    'path' =>  ROOT_PATH.'logs/'.date('Y-m-d').'/easywechat.log',
                    'level' => 'info',
                ],
            ],
        ],
    ],

    /*
     * 路由配置
     */
    'route'            => [
        /*
         * 开放平台第三方平台路由配置
         */
        // 'open_platform' => [
        //     'uri' => 'serve',
        //     'action' => Overtrue\LaravelWeChat\Controllers\OpenPlatformController::class,
        //     'attributes' => [
        //         'prefix' => 'open-platform',
        //         'middleware' => null,
        //     ],
        // ],
    ],

    /*
     * 微信公众号
     */
    'official_account' => [
        'default' => [
            'app_id'  => env('WECHAT_OFFICIAL_ACCOUNT_APPID', ''),         // AppID
            'secret'  => env('WECHAT_OFFICIAL_ACCOUNT_SECRET', ''),    // AppSecret
            'token'   => env('WECHAT_OFFICIAL_ACCOUNT_TOKEN', 'your-token'),           // Token
            'aes_key' => env('WECHAT_OFFICIAL_ACCOUNT_AES_KEY', ''),                 // EncodingAESKey
            'log'    => [ //生成错误日志
                'level' => 'debug',
                'path' => '/www/wwwroot/default/easywechat.log',
            ]
            /*
             * OAuth 配置
             *
             * scopes：公众平台（snsapi_userinfo / snsapi_base），开放平台：snsapi_login
             * callback：OAuth授权完成后的回调页地址(如果使用中间件，则随便填写。。。)
             * enforce_https：是否强制使用 HTTPS 跳转
             */
            // 'oauth'   => [
            //     'scopes'        => array_map('trim', explode(',', env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_SCOPES', 'snsapi_userinfo'))),
            //     'callback'      => env('WECHAT_OFFICIAL_ACCOUNT_OAUTH_CALLBACK', '/examples/oauth_callback.php'),
            //     'enforce_https' => true,
            // ],
        ],
    ],

    /*
     * 开放平台第三方平台
     */
    // 'open_platform' => [
    //     'default' => [
    //         'app_id'  => env('WECHAT_OPEN_PLATFORM_APPID', ''),
    //         'secret'  => env('WECHAT_OPEN_PLATFORM_SECRET', ''),
    //         'token'   => env('WECHAT_OPEN_PLATFORM_TOKEN', ''),
    //         'aes_key' => env('WECHAT_OPEN_PLATFORM_AES_KEY', ''),
    //     ],
    // ],

    /*
     * 小程序
    */
     'mini_program' => [
         'app_id'  => env('WECHAT_MINI_APPID', 'wx6382e7027427b2bd'),
         'secret'  => env('WECHAT_SECRET', 'c28b150d668d40f658714f56a1c05cc4'),
//         'token'   => 'yosdfsdfoken',
//             'aes_key' => env('WECHAT_MINI_PROGRAM_AES_KEY', ''),
         'aes_key' =>'',
         'response_type' => 'array',
//         'log'    => [ //生成错误日志
//             'level' => 'debug',
//             'file' => '/www/wwwroot/tapi.shangxunyicai.com/storage/logs/easywechat.log',
//         ]
     ],


    /*
     * 微信支付
     */
     'payment' => [
         'default' => [
             'sandbox'    => env('WECHAT_PAYMENT_SANDBOX', false),
             'app_id'     => env('WECHAT_PAYMENT_APPID', ''),
             'mch_id'     => env('WECHAT_PAYMENT_MCH_ID', 'your-mch-id'),
             'key'        => env('WECHAT_PAYMENT_KEY', 'key-for-signature'),
             'cert_path'  => env('WECHAT_PAYMENT_CERT_PATH', 'path/to/cert/apiclient_cert.pem'),    // XXX: 绝对路径！！！！
             'key_path'   => env('WECHAT_PAYMENT_KEY_PATH', 'path/to/cert/apiclient_key.pem'),      // XXX: 绝对路径！！！！
             'notify_url' => env('NOTIFY_URL_PAY', 'payment-notify-url'),
             'notify_url_refund' => env('NOTIFY_URL_REFUND', 'goods-order-notify-url')
         ],
         // ...
     ],
    /*
     * 企业微信
     */
    // 'work' => [
    //     'default' => [
    //         'corp_id' => 'xxxxxxxxxxxxxxxxx',
    //         'agent_id' => 100020,
    //         'secret'   => env('WECHAT_WORK_AGENT_CONTACTS_SECRET', ''),
    //          //...
    //      ],
    // ],
];
